package org.zoomdev.zoom.aop.interceptors;


import org.zoomdev.zoom.aop.Interceptor;
import org.zoomdev.zoom.aop.Invoker;

import java.lang.reflect.Method;

/**
 * 提供详细的日志
 *
 * @author jzoom
 */
public class LogInterceptor implements Interceptor {

    public LogInterceptor() {

    }

    @Override
    public Object intercept(Invoker invoker, Method method, Object target, Object[] args) throws Throwable {
        System.out.println("before invoke");
        try {
            return invoker.invoke(target, args);
        } finally {
            System.out.println("after invoke");
        }
    }
}
